package cn.chyn.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HomeController {
    @GetMapping("/api/data")
    public String getData() {
        System.out.println("请求成功");

        return "Hello from backend!";
    }

    @GetMapping("/api/json")
    public Object getJsonData() {
        return new Object() {
            public String message = "Hello from backend!";
            public int code = 200;
        };
    }
}
